<?php echo $html->css('articles.css') ?>
<div class="left">
    <h2 class='titles'><?php echo $groupPost['GroupPost']['title']?></h2>
    <div id='post-view'>
        <div class="article">
            <div class="user-avatar">
                <?php echo $avatar->userLink($groupPost['User']) ?>
            </div>
            <div class="article-body">
                <div class="info">
                    <span class="author">
                        <?php echo $linker->userLink($groupPost['User']) ?>
                    </span>
                    <span class="time"><?php echo $groupPost['GroupPost']['created'] ?></span>
                </div>
                <div class="content-body">
                    <?php echo $formater->text($groupPost['GroupPost']['body']) ?>

                    <?php if ($own): ?><p >
                            <?php echo $this->Html->link(__('修改', true), array('action' => 'edit', $groupPost['GroupPost']['id'])); ?>
                            <?php echo $this->Html->link(__('删除', true), array('action' => 'delete', $groupPost['GroupPost']['id']), null, sprintf(__('确定删除吗?', true))); ?></p>
                    <?php endif ?>
                </div>
            </div>
            <div class="clear" ></div>
        </div>
        <ul class="comment-list">
            <?php 	foreach ($comments as $comment): ?>
            <li>
                <div class="comment-entry">
                    <div class="user-avatar">
                            <?php echo $this->Avatar->userLink($comment['User']) ?>
                    </div>
                    <div class="comment-body">
                        <div class="info">
                            <span class="author">
                                    <?php echo $linker->userLink($comment['User']) ?>
                            </span>
                            <span class="time"><?php echo $comment['GroupPostComment']['created'] ?></span>
                            <span>
                                    <?php if ($own): ?>
                                        <?php echo $this->Html->link(__('Delete', true), array('controller'=>'group_post_comments','action' => 'delete', $comment['GroupPostComment']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $comment['GroupPostComment']['id'])); ?>

                                    <?php endif ?>
                            </span>
                        </div>
                        <div class="content">
                            <div><?php echo $formater->text($comment['GroupPostComment']['body']) ?></div>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
            </li>


            <?php endforeach; ?>
        </ul>
        <div class="comment-form">
            <?php echo $this->Form->create('GroupPostComment',array('url'=>'/group_post_comments/add'));?>
            <div class="sub-titles"><?php __('你的评论'); ?></div>
            <?php
            echo $this->Form->textArea('body');
            echo $this->Form->hidden('user_id',array('value'=>$cuid));
            echo $form->hidden('group_post_id',array('value'=>$groupPost['GroupPost']['id']));
            ?>
            <?php echo $this->Form->end(__('添加', true),array('class'=>'btn',"div"=>null));?>
        </div>

    </div>

</div>
<div class="right">
    <h3><?php __('Actions'); ?></h3>
    <ul>

        <li><?php echo $this->Html->link("返回{$groupPost['Group']['name']}小组", "/group/{$groupPost['Group']['gid']}"); ?> </li>

    </ul>
</div>
